package com.koron.css2.newProjectCenter.mapper;

import com.koron.css2.newProjectCenter.bean.ProjectReceiptBean;
import com.koron.css2.newProjectCenter.bean.ProjectReceiptInvoiceBean;
import com.koron.css2.newProjectCenter.bean.query.ProjectReceiptQueryBean;
import com.koron.css2.newProjectCenter.vo.ProjectReceiptPrintVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;


public interface ProjectReceiptMapper {

    /**
     * 新增收款单
     * @param bean
     * @return
     */
    Integer add(ProjectReceiptBean bean);

    /**
     * 工程2.1新增收款单
     * @param bean
     * @return
     */
    Integer addNew(ProjectReceiptBean bean);

    /**
     * 工程收款列表
     */
    List<ProjectReceiptBean> list(ProjectReceiptQueryBean queryBean);
    int selectNoChargeCoun();
    /**
     * 工程收款列表合计行
     */
    List<ProjectReceiptBean> listTotal(ProjectReceiptQueryBean queryBean);

    /**
     * 收款
     */
    Integer charging(ProjectReceiptBean bean);

    /**
     * 按ID查询
     */
    ProjectReceiptBean query(@Param("id") String id);
    /**
     * 查询某单据有几个收款单
     * @param billId
     * @return
     */
    int totalCount(@Param("billId") String billId);

    Double total(@Param("billId") String billId);

    Double totaleq(@Param("billNo") String billNo);
    /**
     * 获取收据信息
     * @param id
     * @return
     */
    ProjectReceiptPrintVO queryReceiptPrint(@Param("id")String id);
    /**
     * 保存发票信息
     * @param bean
     * @return
     */
    Integer saveProjectReceiptInvoice(ProjectReceiptBean bean);
    /**
     * 根据单据id和单据类型获取用户编号
     * @param id
     * @return
     */
    String getUserNoById(@Param("billType")String billType,@Param("id") String id);
    /**
     * 删除单据
     * @param billType
     * @param id
     * @return
     */
    int deleteById(@Param("id")String id);
    int deleteByBillId(@Param("flag")int flag,@Param("id")String id);
    int updateInvoice(ProjectReceiptInvoiceBean bean);

}
